<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>AdTagExplorer Options</title>
<style type="text/css">
body {
	min-width: 400px;
	overflow-x: hidden;
	font-family: verdana;
	font-size: 10px;
}
</style>
<script type="text/javascript">
		//TODO: write fields to local storage
		
function save_options() {
	var dfaCheckBox = document.getElementById("dfaCheckBox");
	if(dfaCheckBox.checked == true) {
		localStorage["dfa"] = true;
	}else{
		localStorage["dfa"] = false;
	}
	var ffaCheckBox = document.getElementById("ffaCheckBox");
	if(dfaCheckBox.checked == true) {
		localStorage["ffa"] = true;
	}else{
		localStorage["ffa"] = false;
	}
	var campaigncodes = document.getElementById("campaigncodes");
	localstorage["campaigncodes"] = campaigncodes.innerText;
	
	var status = document.getElementById("status");
	status.innerHTML = "Options Saved.";
	setTimeout(function() {
		status.innerHTML = "";
		}, 750);
}

function restore_options() {
	if(localStorage["dfa"] == true){
		document.getElementById("dfaCheckBox").checked = true;
	}
	if(localStorage["ffa"] == true){
		document.getElementById("ffaCheckBox").checked = true;
	}
	document.getElementById("campaigncodes").innerText = localstorage["campaigncodes"];
}
		
	

	</script>
</head>
<body onload="restore_options()">
<div id="status"></div>
<h1>Options for AdTagExplorer</h1>
<h2>Ad Servers to catch</h2>
<p><input type="checkbox" id="dfaCheckBox" value="ffa"> DFA</p>
<p><input type="checkbox" id="dfaCheckBox" value="ffa"> FFA</p>
<p><input type="checkbox" value="dfa"> DFA</p>

<h2>Static match against campaign codes:</h2>
<p>Enter campaign code and names in JSON or XML format.</p>
<textarea cols="100" rows="25" name="campaigncodes">
{	
	"ad server": "ffa",
	"set": "campaigns",
	"000001": "SampleCampaign1",
	"000002": "SampleCampaign2",
	"000003": "SampleCampaign3"
}
</textarea>
<h2></h2>
</body>
</html>